<html>
<head><meta charset="utf-8"><title>freeze in LLVM! · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html">freeze in LLVM!</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="180044027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/freeze%20in%20LLVM%21/near/180044027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html#180044027">(Nov 06 2019 at 15:36)</a>:</h4>
<p><span class="user-mention" data-user-id="124289">@rkruppe</span> <span class="user-mention" data-user-id="132920">@gnzlbg</span> wow, it finally happened :D<br>
<a href="https://github.com/llvm/llvm-project/blob/master/llvm/docs/LangRef.rst#L10202" target="_blank" title="https://github.com/llvm/llvm-project/blob/master/llvm/docs/LangRef.rst#L10202">https://github.com/llvm/llvm-project/blob/master/llvm/docs/LangRef.rst#L10202</a></p>



<a name="180044576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/freeze%20in%20LLVM%21/near/180044576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html#180044576">(Nov 06 2019 at 15:42)</a>:</h4>
<p>Yeah, it's nice isn't it? :3 Let's hope undef dies soon, too.</p>



<a name="180156579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/freeze%20in%20LLVM%21/near/180156579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html#180156579">(Nov 07 2019 at 17:54)</a>:</h4>
<p>Where's the RFC for a freeze intrinsic? ;P</p>



<a name="180174499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/freeze%20in%20LLVM%21/near/180174499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html#180174499">(Nov 07 2019 at 20:50)</a>:</h4>
<p>In Rust? That's a different can of worms because LLVM's <code>freeze</code> operates on a single SSA value while Rust types are generally not mapped to SSA values.</p>



<a name="180221163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/freeze%20in%20LLVM%21/near/180221163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html#180221163">(Nov 08 2019 at 11:26)</a>:</h4>
<p><span class="user-mention" data-user-id="203193">@aqjune</span>  was this you? :D</p>



<a name="180221210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/freeze%20in%20LLVM%21/near/180221210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html#180221210">(Nov 08 2019 at 11:27)</a>:</h4>
<p>The docs do not mention that the <code>freeze</code> intrinsic might write to the memory</p>



<a name="180221218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/freeze%20in%20LLVM%21/near/180221218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html#180221218">(Nov 08 2019 at 11:27)</a>:</h4>
<p>and it is unclear whether doing that might be a data-race</p>



<a name="180221220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/freeze%20in%20LLVM%21/near/180221220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html#180221220">(Nov 08 2019 at 11:27)</a>:</h4>
<p>(how does it synchronize?)</p>



<a name="180222090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/freeze%20in%20LLVM%21/near/180222090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html#180222090">(Nov 08 2019 at 11:42)</a>:</h4>
<p>Different <code>freeze</code>! This thread is about the instruction that freezes a single SSA value, not a range of memory. You're thinking of the intrinsic discussed in <a href="#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/Intrinsic.20for.20freezing.20bytes" title="#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/Intrinsic.20for.20freezing.20bytes">https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/Intrinsic.20for.20freezing.20bytes</a> which hasn't landed yet.</p>



<a name="180230756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/freeze%20in%20LLVM%21/near/180230756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html#180230756">(Nov 08 2019 at 13:48)</a>:</h4>
<p>Ah!</p>



<a name="180230840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/freeze%20in%20LLVM%21/near/180230840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html#180230840">(Nov 08 2019 at 13:49)</a>:</h4>
<p>So this looks useful as in of itself.</p>



<a name="180245047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/freeze%20in%20LLVM%21/near/180245047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> aqjune <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/freeze.20in.20LLVM!.html#180245047">(Nov 08 2019 at 16:18)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span>  Hi, yes. :)<br>
Replacing undef with poison is the next target. I guess this might need another time frame, but I believe people will finally like it as well.<br>
The freeze intrinsic for memory is still effective as <span class="user-mention" data-user-id="124289">@rkruppe</span> said . But its semantics is not crystal clear yet, and after discussion with people (including <span class="user-mention" data-user-id="120791">@RalfJ</span>) I became  to think that it will be informative to implement freeze intrinsics with several different semantics and see which one generates efficient code with existing LLVM optimizations. It may take some time, but having such data will be helpful for the design choice.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>